/* eslint-disable array-callback-return */
/* eslint-disable no-restricted-syntax */
/* eslint-disable no-param-reassign */
/*
 * @Author: 李景福|1779062242@qq.com(lijingfu)
 * @Date: 2022-03-19 21:38:50
 * @LastEditors: 李景福|1779062242@qq.com(lijingfu)
 * @LastEditTime: 2022-04-16 16:55:57
 * @Description: 所有报警单列表接口
 * @Administrator: 李景福|1779062242@qq.com(lijingfu)
 * @Copyright: 文件版本号
 */

'use strict';

const { Service } = require('egg');

class AlarmallServer extends Service {
  constructor(ctx) {
    super(ctx);
    this.Alarm = this.ctx.model.Alarm;
  }

  // eslint-disable-next-line consistent-return
  async getAlarmAll(startDate, endDate) {
    const { ctx, Alarm } = this;
    const result = await Alarm.getAlarmAll(startDate, endDate);
    if (!result) {
      ctx.throw('暂无数据');
    } else {
      return result;
    }
  }
}

module.exports = AlarmallServer;
